//
//  ByModelUser.m
//  jinpuyiyuan_ios
//
//  Created by mc on 2017/12/4.
//  Copyright © 2017年 mc. All rights reserved.
//

#import "ByModelUser.h"

@implementation ByModelUser
- (void)setAttributes:(NSDictionary *)jsonDic{
    [super setAttributes:jsonDic];
    _uid = [NSString stringWithFormat:@"%@",jsonDic[@"id"]];
    _head = BOYE_PICTURE_VIEW_URL(jsonDic[@"head"]);
    _token = jsonDic[@"user_token"];
    
}


-(void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.uid forKey:@"uid"];
    [aCoder encodeObject:self.idnumber forKey:@"idnumber"];
    [aCoder encodeObject:self.head forKey:@"head"];
    [aCoder encodeObject:self.username forKey:@"username"];
    [aCoder encodeObject:self.sign forKey:@"sign"];
    [aCoder encodeObject:self.nickname forKey:@"nickname"];
    [aCoder encodeObject:self.token forKey:@"token"];
    [aCoder encodeObject:self.sex forKey:@"sex"];
    [aCoder encodeObject:self.head_pic forKey:@"head_pic"];
    [aCoder encodeObject:self.user_money forKey:@"user_money"];
    [aCoder encodeObject:self.mobile forKey:@"mobile"];
    [aCoder encodeObject:self.app_push forKey:@"app_push"];
    [aCoder encodeObject:self.withdrawals_money forKey:@"withdrawals_money"];
    [aCoder encodeObject:self.type forKey:@"type"];
    [aCoder encodeObject:self.invitation_code forKey:@"invitation_code"];
    
}

-(id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self)
    {
        self.uid = [aDecoder decodeObjectForKey:@"uid"];
        self.idnumber = [aDecoder decodeObjectForKey:@"idnumber"];
        self.head = [aDecoder decodeObjectForKey:@"head"];
        self.username = [aDecoder decodeObjectForKey:@"username"];
        self.sign = [aDecoder decodeObjectForKey:@"sign"];
        self.nickname = [aDecoder decodeObjectForKey:@"nickname"];
        self.token = [aDecoder decodeObjectForKey:@"token"];
        self.sex = [aDecoder decodeObjectForKey:@"sex"];
        self.head_pic = [aDecoder decodeObjectForKey:@"head_pic"];
        self.user_money = [aDecoder decodeObjectForKey:@"user_money"];
        self.mobile = [aDecoder decodeObjectForKey:@"mobile"];
        self.app_push = [aDecoder decodeObjectForKey:@"app_push"];
        self.withdrawals_money = [aDecoder decodeObjectForKey:@"withdrawals_money"];
        self.type = [aDecoder decodeObjectForKey:@"type"];
        self.invitation_code = [aDecoder decodeObjectForKey:@"invitation_code"];
    }
    return self;
}



@end
